const categoryId = getUrlParams('categoryId');

// 根据分类ID获取文章列表
$.ajax({
  type: 'get',
  url: '/posts/category/' + categoryId,
  success: function (response) {
    const html = template('listTpl', {data: response});
    $('#listBox').html(html);
  }
})

// 根据分类ID获取分类信息
$.ajax({
  type: 'get',
  url: '/categories/' + categoryId,
  success: function (response) {
    $('#categoryTitle').html(response.title);
  }
})